home *** CD-ROM | disk | FTP | other *** search
/ Collection of Tools & Utilities / Collection of Tools and Utilities.iso / keyb / f11f12.zip / F11F12.ASM next >
Assembly Source File  |  1988-05-14  |  2KB  |  62 lines

  1. ;     F11F12.ASM
  2. ;
  3. ;     This tiny TSR fixes the BIOS call to get characters from the
  4. ;     keyboard so that F11 and F12 are returned.  It does this by mapping
  5. ;     the "old" calls to the "new" calls, which are upwardly-compatible
  6. ;     with the old ones (after mapping the arrow keys back to the normal
  7. ;     zero-code).
  8. ;
  9. ;     Warning: this one MUST be loaded before any other TSR's that replace
  10. ;     the keyboard BIOS call!
  11. ;
  12. code_seg     segment
  13.      assume  CS:code_seg
  14.      org     100H
  15.  
  16. old_int   label dword
  17. begin:    jmp     short init
  18.           dw 0
  19.  
  20. grab      proc   far
  21. bint:     cmp    AH,1       ; old read or test keyboard ?
  22.           jna    bint0
  23.           jmp    [old_int]  ; all other calls
  24.  
  25. bint0:    or     AH,10H     ; make it extended
  26.           pushf
  27.           call   [old_int]
  28.           pushf
  29.           cmp    AL,0E0H    ; put extended keypad keys back
  30.           jne    bint3
  31.           xor    AL,AL
  32. bint3:    popf
  33.           ret    2
  34. grab      endp
  35.  
  36. ;--- end of TSR portion ---
  37.  
  38.      assume CS:code_seg,DS:code_seg
  39. init:     mov    AX,12FFH   ; see if new shift-flag func works
  40.           int    16H
  41.           cmp    AL,0FFH    ; if unchanged, probably not...
  42.           jne    init1
  43.           int    20H        ; so exit w.o. doing anything
  44. init1:    xor    AX,AX
  45.           mov    ES,AX
  46.           mov    AX,ES:[58H]; copy old int pointer
  47.           mov    word ptr old_int,AX
  48.           mov    AX,ES:[5AH]
  49.           mov    word ptr old_int[2],AX
  50.           cli
  51.           mov    AX,offset bint
  52.           mov    ES:[58H],AX
  53.           mov    AX,CS
  54.           mov    ES:[5AH],AX
  55.           sti
  56.           mov    DX,offset init
  57.           int    27H
  58.  
  59. code_seg  ends
  60.  
  61.           end    begin
  62.